﻿<%@ Control Language="C#" ClassName="ArticleFields" %>

<script runat="server">
    protected void dataMainContent_OnInit(object sender, EventArgs e)
    {
        lblScripts.Text = "<script type='text/javascript' language='javascript'>$(document).ready(function () {" +
            String.Format("SetTinyMCE('{0}');", ((TextBox)sender).ClientID) + " });";
    }
</script>

<asp:FormView ID="FormView1" runat="server">
    <ItemTemplate>

        <script type="text/javascript">
            function SetTinyMCE(Id) {
                tinyMCE.init({
                    // General options 
                    mode: "exact",
                    theme: "advanced",
                    elements: Id,
                    plugins: "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
                    setup: function(ed) {
                        ed.onKeyPress.add(
                function(ed, evt) {
                }
                );
                    },
                    // Theme options 
                    theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
                    theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
                    theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
                    theme_advanced_buttons4: "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
                    theme_advanced_toolbar_location: "top",
                    theme_advanced_toolbar_align: "left",
                    theme_advanced_statusbar_location: "bottom",
                    theme_advanced_resizing: true,
                    // Example content CSS (should be your site CSS) 
                    content_css: "css/content.css",
                    // Drop lists for link/image/media/template dialogs 
                    template_external_list_url: "lists/template_list.js",
                    external_link_list_url: "lists/link_list.js",
                    external_image_list_url: "lists/image_list.js",
                    media_external_list_url: "lists/media_list.js",
                    // Style formats 
                    style_formats: [
                { title: 'Bold text', inline: 'b' },
                { title: 'Red text', inline: 'span', styles: { color: '#ff0000'} },
                { title: 'Red header', block: 'h1', styles: { color: '#ff0000'} },
                { title: 'Example 1', inline: 'span', classes: 'example1' },
                { title: 'Example 2', inline: 'span', classes: 'example2' },
                { title: 'Table styles' },
                { title: 'Table row 1', selector: 'tr', classes: 'tablerow1' }
            ],
                    // Replace values for the template plugin 
                    template_replace_values: {
                        username: "Some User",
                        staffid: "991234"
                    }
                });
            }
        </script>

        <asp:HiddenField ID="hdfOriginalId" runat="server" Value='<%# Bind("OriginalId") %>' />
        <table border="0" cellpadding="3" cellspacing="1">
            <tr>
                <td class="literal" style="width: 100px;">
                    <asp:Label ID="lbldataTitle" runat="server" Text="Tiêu đề:" AssociatedControlID="dataTitle" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataTitle" Text='<%# Bind("Title") %>' MaxLength="200"></asp:TextBox><asp:RequiredFieldValidator
                        ID="ReqVal_dataTitle" runat="server" Display="Dynamic" ControlToValidate="dataTitle"
                        ErrorMessage="Yêu cầu"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="literal" valign="top">
                    <asp:Label ID="lbldataIntro" runat="server" Text="Giới thiệu:" AssociatedControlID="dataIntro" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataIntro" Text='<%# Bind("Intro") %>' TextMode="MultiLine"
                        Width="250px" Rows="5"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataMainContent" runat="server" Text="Main Content:" AssociatedControlID="dataMainContent" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataMainContent" Text='<%# Bind("MainContent") %>'
                        TextMode="MultiLine" Width="250px" Rows="5" OnInit="dataMainContent_OnInit"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataLinkImage" runat="server" Text="Link Image:" AssociatedControlID="dataLinkImage" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataLinkImage" Text='<%# Bind("LinkImage") %>' MaxLength="200"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataMenuId" runat="server" Text="Menu Id:" AssociatedControlID="dataMenuId" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataMenuId" Text='<%# Bind("MenuId") %>'></asp:TextBox><asp:RequiredFieldValidator
                        ID="ReqVal_dataMenuId" runat="server" Display="Dynamic" ControlToValidate="dataMenuId"
                        ErrorMessage="Required"></asp:RequiredFieldValidator><asp:RangeValidator ID="RangeVal_dataMenuId"
                            runat="server" Display="Dynamic" ControlToValidate="dataMenuId" ErrorMessage="Invalid value"
                            MaximumValue="9223372036854775807" MinimumValue="-9223372036854775808" Type="Double"></asp:RangeValidator>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataMenuTitle" runat="server" Text="Menu Title:" AssociatedControlID="dataMenuTitle" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataMenuTitle" Text='<%# Bind("MenuTitle") %>' MaxLength="200"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataMenuAlias" runat="server" Text="Menu Alias:" AssociatedControlID="dataMenuAlias" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataMenuAlias" Text='<%# Bind("MenuAlias") %>' MaxLength="200"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataMenuLink" runat="server" Text="Menu Link:" AssociatedControlID="dataMenuLink" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataMenuLink" Text='<%# Bind("MenuLink") %>' MaxLength="200"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataLanguage" runat="server" Text="Language:" AssociatedControlID="dataLanguage" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataLanguage" Text='<%# Bind("Language") %>' MaxLength="20"></asp:TextBox><asp:RequiredFieldValidator
                        ID="ReqVal_dataLanguage" runat="server" Display="Dynamic" ControlToValidate="dataLanguage"
                        ErrorMessage="Required"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataIsDisabled" runat="server" Text="Is Disabled:" AssociatedControlID="dataIsDisabled" />
                </td>
                <td>
                    <asp:RadioButtonList runat="server" ID="dataIsDisabled" SelectedValue='<%# Bind("IsDisabled") %>'
                        RepeatDirection="Horizontal">
                        <asp:ListItem Value="True" Text="Yes" Selected="True"></asp:ListItem>
                        <asp:ListItem Value="False" Text="No"></asp:ListItem>
                        <asp:ListItem Value="" Text="Pick ..." Enabled="False"></asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataIsRemoved" runat="server" Text="Is Removed:" AssociatedControlID="dataIsRemoved" />
                </td>
                <td>
                    <asp:RadioButtonList runat="server" ID="dataIsRemoved" SelectedValue='<%# Bind("IsRemoved") %>'
                        RepeatDirection="Horizontal">
                        <asp:ListItem Value="True" Text="Yes" Selected="True"></asp:ListItem>
                        <asp:ListItem Value="False" Text="No"></asp:ListItem>
                        <asp:ListItem Value="" Text="Pick ..." Enabled="False"></asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataDatePublish" runat="server" Text="Date Publish:" AssociatedControlID="dataDatePublish" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataDatePublish" Text='<%# Bind("DatePublish", "{0:d}") %>'
                        MaxLength="10"></asp:TextBox><asp:ImageButton ID="cal_dataDatePublish" runat="server"
                            SkinID="CalendarImageButton" OnClientClick="javascript:showCalendarControl(this.previousSibling);return false;" /><asp:RequiredFieldValidator
                                ID="ReqVal_dataDatePublish" runat="server" Display="Dynamic" ControlToValidate="dataDatePublish"
                                ErrorMessage="Required"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataDateCreate" runat="server" Text="Date Create:" AssociatedControlID="dataDateCreate" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataDateCreate" Text='<%# Bind("DateCreate", "{0:d}") %>'
                        MaxLength="10"></asp:TextBox><asp:ImageButton ID="cal_dataDateCreate" runat="server"
                            SkinID="CalendarImageButton" OnClientClick="javascript:showCalendarControl(this.previousSibling);return false;" /><asp:RequiredFieldValidator
                                ID="ReqVal_dataDateCreate" runat="server" Display="Dynamic" ControlToValidate="dataDateCreate"
                                ErrorMessage="Required"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataUserCreate" runat="server" Text="User Create:" AssociatedControlID="dataUserCreate" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataUserCreate" Text='<%# Bind("UserCreate") %>'
                        MaxLength="200"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataDateModify" runat="server" Text="Date Modify:" AssociatedControlID="dataDateModify" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataDateModify" Text='<%# Bind("DateModify", "{0:d}") %>'
                        MaxLength="10"></asp:TextBox><asp:ImageButton ID="cal_dataDateModify" runat="server"
                            SkinID="CalendarImageButton" OnClientClick="javascript:showCalendarControl(this.previousSibling);return false;" /><asp:RequiredFieldValidator
                                ID="ReqVal_dataDateModify" runat="server" Display="Dynamic" ControlToValidate="dataDateModify"
                                ErrorMessage="Required"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="literal">
                    <asp:Label ID="lbldataUserModify" runat="server" Text="User Modify:" AssociatedControlID="dataUserModify" />
                </td>
                <td>
                    <asp:TextBox runat="server" ID="dataUserModify" Text='<%# Bind("UserModify") %>'
                        MaxLength="200"></asp:TextBox>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:FormView>
<asp:Label ID="lblScripts" runat="server" Text=""></asp:Label>
